unit untCadBancosEdicao;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, untAbsEdicao, Vcl.ImgList, Vcl.ActnList,
  Vcl.ComCtrls, Vcl.ToolWin, Vcl.ExtCtrls, Data.DB, Data.Win.ADODB,
  Vcl.StdCtrls, Vcl.Mask, Vcl.DBCtrls;

type
  TfrmCadBancosEdicao = class(TfrmAbsEdicao)
    qryBancos: TADOQuery;
    dtsBancos: TDataSource;
    qryBancosID: TAutoIncField;
    qryBancosNUMERO: TStringField;
    qryBancosD_NUMERO: TStringField;
    qryBancosNOME: TStringField;
    qryBancosNOME_AGENCIA: TStringField;
    qryBancosCIDADE: TStringField;
    qryBancosUF: TStringField;
    qryBancosAGENCIA: TStringField;
    qryBancosCONTA: TStringField;
    qryBancosCONTA_DIGITO: TStringField;
    qryBancosNOSSO_NUMERO: TStringField;
    qryBancosFK_CEDENTE: TIntegerField;
    qryBancosDT_CADASTRO: TDateTimeField;
    Label1: TLabel;
    DBEdit1: TDBEdit;
    DBEdit2: TDBEdit;
    Label3: TLabel;
    DBEdit3: TDBEdit;
    Label4: TLabel;
    DBEdit4: TDBEdit;
    Label5: TLabel;
    DBEdit5: TDBEdit;
    Label6: TLabel;
    DBEdit6: TDBEdit;
    Label7: TLabel;
    DBEdit7: TDBEdit;
    Label8: TLabel;
    DBEdit8: TDBEdit;
    Label9: TLabel;
    DBEdit9: TDBEdit;
    Label10: TLabel;
    DBEdit10: TDBEdit;
    Label11: TLabel;
    DBEdit11: TDBEdit;
    Label12: TLabel;
    Label13: TLabel;
    Label15: TLabel;
    DBEdit13: TDBEdit;
    datePicker: TDateTimePicker;
    DBLookupComboBox1: TDBLookupComboBox;
    acBoleto: TAction;
    qryBancosAGENCIA_DIGITO: TStringField;
    qryBancosCOD_CEDENTE: TStringField;
    Label2: TLabel;
    DBEdit12: TDBEdit;
    procedure dtsBancosStateChange(Sender: TObject);
    procedure qryBancosAfterOpen(DataSet: TDataSet);
    procedure acBoletoExecute(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  frmCadBancosEdicao: TfrmCadBancosEdicao;

implementation

{$R *.dfm}

uses untDTMPrincipal, untDTMLooKup, untConfBoleto;

procedure TfrmCadBancosEdicao.acBoletoExecute(Sender: TObject);
var
  frm : TfrmConfBoleto;
begin
  try
    frm := TfrmConfBoleto.Create(self,1);
    frm.ShowModal();

  finally
    FreeAndNil(frm);
  end;
end;

procedure TfrmCadBancosEdicao.dtsBancosStateChange(Sender: TObject);
begin
  inherited;
  AtualizarBotoes();
end;

procedure TfrmCadBancosEdicao.qryBancosAfterOpen(DataSet: TDataSet);
begin
  if qryBancosDT_CADASTRO.IsNull then
    datePicker.DateTime := Now
  else
    datePicker.DateTime := qryBancosDT_CADASTRO.AsDateTime;
end;

end.
